using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using Pinwheel.LSerialize;
using UnityEngine;
using Debug = UnityEngine.Debug;

[LSerializable]
public partial class MyPerson
{
    public int Age;
    public string Name;
}

public class TestLSerializable : MonoBehaviour
{
    void Start()
    {
        //RunMyPerson();
        //RunAddressBook();
    }
    
    private void RunMyPerson()
    {
        var sMyPerson = new MyPerson();
        sMyPerson.Age = 10;
        sMyPerson.Name = "Hello World";
        
        var sMyPerson2 = new MyPerson();
        sMyPerson2.Age = 10;
        sMyPerson2.Name = "Hello World";
        
        if (sMyPerson == sMyPerson2)
        {
            Debug.Log("Equals");
        }
        else
        {
            Debug.Log("Not Equals");
        }
        
        var bytes = LSerializer.Serialize(ref sMyPerson);
        var dMyPerson = LSerializer.Deserialize<MyPerson>(bytes);
        
        Debug.Log(dMyPerson.Age);
        Debug.Log(dMyPerson.Name);
    }

}
